{% extends "base_with_frame.html" %} {% block title %}看板{% endblock %}
{% load tags %}

{% block main %}

	<div class="demo">
	<ul class="sortable ui-widget-content" >
		{% for p in projects %}
			<li class="ui-state-default"><span class="ui-icon ui-icon-arrowthick-2-n-s"></span>
				<div>
					<span><a href='/kanban/{{ p|attr:"_id" }}/list'>{{ p.name }}</a></span>
					<span>{{ p.priority }}</span>
					<span>{{ p.owner }}</span>
					<span>{{ p.desc }}</span>
					<span>{{ p.start_time }}</span>
				</div>
			</li>
		{% endfor %}
	</ul>

</div>

<script>
	$(function() {
		$( "button" ).button();
		$( "button" ).click(function() { 
			$(function() {
				$( "#dialog" ).dialog({
					   close: function(event, ui) { 
						   $.ajax({ url: "add", data:{
							   name: $("input[name='name']").val(),
							   name: $("input[name='desc']").val(),
						   },
						   dataType:'json',
						   success: function(ret){
					        	alert("ok" + ret.id);
					      }});
					   }
				});
			});
			
			return false; 
		});
	});
	
	
	
	</script>




<button>Add</button>
<div id="dialog" title="添加项目" style="display:none;">
	<input name="name">
	<input name="desc">
</div>

{% endblock %}
{% block foot %} 
{% endblock %}
